import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/table';
import { airportList } from '@apps/ant-bus/src/views/business/airport/data/api';
import { employeeList } from '@apps/ant-bus/src/views/business/employeeManage/employee/data/api';

export const columns: BasicColumn[] = [
  {
    title: '开卡地',
    dataIndex: 'airportName',
    width: 180,
  },
  {
    title: '销售账号创建时间',
    dataIndex: 'employeeCreateTime',
    width: 180,
  },
  {
    title: '销售姓名',
    dataIndex: 'employeeName',
    width: 120,
  },
  {
    title: '销售账号',
    dataIndex: 'employeeAccount',
    width: 150,
  },
  {
    title: '总售卡',
    dataIndex: 'allNum',
    width: 100,
  },
  {
    title: '总退卡',
    dataIndex: 'tuikaNum',
    width: 100,
  },
  {
    title: '退卡率',
    dataIndex: 'tuikalv',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'startDate',
    label: '开始日期',
    component: 'DatePicker',
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
  {
    field: 'endDate',
    label: '结束日期',
    component: 'DatePicker',
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
  {
    field: 'airportIdArray',
    label: '开卡地',
    component: 'ApiSelect',
    componentProps: {
      api: airportList,
      params: {},
      labelField: 'airportName',
      valueField: 'airportId',
      showSearch: true,
      immediate: true,
      mode: 'multiple',
    },
  },
  {
    field: 'employeeId',
    label: '销售',
    component: 'ApiSelect',
    componentProps: {
      api: employeeList,
      params: { handlerName: 'busEmployeeListHandler' },
      labelField: 'employeeAccountName',
      valueField: 'employeeId',
      immediate: true,
      showSearch: true,
    },
  },
  {
    field: 'tuikalvStart',
    label: '退卡比例起',
    component: 'Input',
  },
  {
    field: 'tuikalvEnd',
    label: '退卡比例止',
    component: 'Input',
  },
];
